package javaeSE.sexercise;
// 银行，账户，客户三个类的小练习
public class BankTest {
	public static void main(String[] args) {
		
		Bank bank = new Bank();
		// 银行先添加客户  客户设置账户
		bank.addCustomer("Jane", "Smith");
		
		//连续操作
		Account account = new Account(2000);
		System.out.println("账户"+account);
		bank.getCustomer(0).setAccount(account);
		
		bank.getCustomer(0).getAccount().withdraw(500);
		double balance = bank.getCustomer(0).getAccount().getBalance();
		System.out.println("客户取钱后：" + bank.getCustomer(0).getFirstName() + "的账户余额为：" + balance);

		bank.getCustomer(0).getAccount().deposit(1000);
		double balance2 = bank.getCustomer(0).getAccount().getBalance();
		System.out.println("客户存钱后：" + bank.getCustomer(0).getFirstName() + "的账户余额为：" + balance2);
		System.out.println("***********************");

		bank.addCustomer("万里", "杨");
		
		System.out.println("银行客户的个数为：" + bank.getNumOfCustomers());
		
		
	}
}
